package org.example.my.coonfige;


import lombok.extern.slf4j.Slf4j;
import org.example.my.model.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;
@ControllerAdvice
@ResponseBody
@Slf4j
public class ExceptionHandler {
    @org.springframework.web.bind.annotation.ExceptionHandler(Exception.class)
    public Result handleException(Exception e) {
        log.error("发生异常 e:", e);
        return Result.fail("服务器异常");
    }

}
